﻿using System;
using Gp.GCX;
using Gp.Scripts.Core;
using QFramework;
using UnityEngine;

namespace Gp.Scripts.GUI {
    public abstract class DisplayWithUnitUI : MonoBehaviour, IController {
        protected static BaseUnit CurrentUnit => Global.Get<BattleSystem>().CurrentUnit;

        protected virtual void Start() {
            this.Enable(false);
            this.RegisterEvent<Event_BattleInit>(e => this.Enable());
            this.RegisterEvent<Event_BattleEnd>(e => this.Enable(false));
        }

        public IArchitecture GetArchitecture() {
            return MainArchitecture.Interface;
        }
    }
}